<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
// Get data for the form from somewhere...
String name = "";	
String email = "";
String web_site = "";
String phone = "";
String date_birth= "";
String address = "";
String levelstudy = "";
String specialite = "";
String domain = "";
String languages = "";
String position_wanted = "";
String salary_wanted = "";
String description = "";
String sex = "";
String year_experience = "";

// Deja login 
if((String)session.getAttribute("login") != null )
{
	if ((String)session.getAttribute("name")!= null)
		name = (String)session.getAttribute("name");
	
	if ((String)session.getAttribute("sex")!= null)		
		sex = (String)session.getAttribute("sex");

	if ((String)session.getAttribute("email")!= null)
		email = (String)session.getAttribute("email");


	if ((String)session.getAttribute("web_site")!= null)
		web_site = (String)session.getAttribute("web_site");
	
	if ((String)session.getAttribute("phone")!= null)
		phone = (String)session.getAttribute("phone");

	if ((String)session.getAttribute("date_birth")!= null)
		date_birth = (String)session.getAttribute("date_birth");
	
	if ((String)session.getAttribute("address")!= null)
		address = (String)session.getAttribute("address");

	if ((String)session.getAttribute("levelstudy") != null )
		levelstudy = (String)session.getAttribute("levelstudy");
	
	if ((String)session.getAttribute("position_wanted")!= null)
		position_wanted = (String)session.getAttribute("position_wanted");	
	if ((String)session.getAttribute("specialite")!= null)
		specialite = (String)session.getAttribute("specialite");	

	if ((String)session.getAttribute("domain")!= null)
		domain = (String)session.getAttribute("domain");
	
	if ((String)session.getAttribute("languages")!= null)
		languages = (String)session.getAttribute("languages");

	if ((String)session.getAttribute("year_experience") != null)
		year_experience = (String)session.getAttribute("year_experience");

	if ((String)session.getAttribute("salary_wanted")!= null)
		salary_wanted = (String)session.getAttribute("salary_wanted");
	
	if ((String)session.getAttribute("description")!= null)
		description = (String)session.getAttribute("description");
}

%>

<html>
<head>

<script>
function initText(control,value) {
	  // Initialize a text field
	  control.value = value;
	}	
function initAll(form) {
// Initialize all form controls
  with (form) {
	  initText(name,"<%=name%>");
	  initText(email,"<%=email%>");
	  initText(web_site,"<%=web_site%>");
	  initText(phone,"<%=phone%>");
	  initText(date_birth,"<%=date_birth%>");
	  initText(address,"<%=address%>");
	  initText(levelstudy,"<%=levelstudy%>");
	  initText(specialite,"<%=specialite%>");
	  initText(domain,"<%=domain%>");
	  initText(languages,"<%=languages%>");
	  initText(position_wanted,"<%=position_wanted%>");
	  initText(salary_wanted,"<%=salary_wanted%>");
	  initText(description,"<%=description%>");	  
	  initText(sex,"<%=sex%>");
	  initText(year_experience,"<%=year_experience%>");
	  
  }
}
</script>

	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>Gestion de CV</title> 
    <meta name="author" content="supermen_IFI" />
    <meta name="keywords" content=""/>
 	<meta name="description" content=""/>
     <!-- [template css] begin -->
	<link rel="stylesheet" href="css/screen.css" type="text/css" media="screen, projection" />
	<link rel="stylesheet" href="css/960.css" type="text/css" media="screen, projection" />
    <link rel="stylesheet" href="css/print.css" type="text/css" media="print" /> 
    <script type="text/javascript" src="js/jquery-1.3.1.min.js"></script>
	<script type="text/javascript" src="js/functions.js"></script>
	<script type="text/javascript" src="js/jquery.validate.min.js"></script>
    
</head>
<body class="body" onload="initAll(document.cvForm)">

	<!-- START TOP SECTION -->
	<div class="container_12">
	
		<!-- START LOGO -->
		<div class="grid_4 header">
			<img src="images/slider/banner-p7.jpg" alt="FEJOB" />
			<div align="right">
				<a href="Homee.jsp" title="Sign Out"><font size="3">Sign Out</font></a>
			</div>	
		</div>
		<!-- END LOGO -->
   	 
		<!-- START NAVIGATION -->
   	  	<div class="grid_8 header">
   	  		<div id="navigation">
				<ul id="nav">
					<li id="home"><a href="Home.jsp" title="Home page">Home</a></li>
					<li id="about"><a href="About.html" title="About">About</a></li>
					<li id="search_job"><a href="SearchJob.jsp" title="Search Job">Search Job</a></li>
					<li id="cv_management"><a href="CVManagement.jsp" title="CV Management" class="currentPage">CV Management</a></li>
					
				</ul>
			</div>
		</div>
		<!-- END NAVIGATION -->
		
		<div class="clear"></div>
	</div>
	<!-- END TOP SECTION -->
   
	<!-- START MEDIUM SECTION -->
	<div class="container_12 medium">
	
		<!-- START GET IN TOUCH TEXT -->
   		<div class="grid_6">
	   		<div class="getTouch">
	   			<h2><span class="orange">CV Management</span></h2>
	   			<p>
					This section is used to create your CV.
	   			</p>
	   			
	   		</div>
   		</div>
   		<!-- END GET IN TOUCH TEXT -->
   	
		<div class="clear"></div>
		
	</div>
	<!-- END MEDIUM SECTION -->
 
	<!-- START BOTTOM SECTION -->
	<div class="container_12">
	
		<!-- START CONTACT FORM -->
		<div class="grid_6" style="border: solid 1px #BBB6A5;padding:15px;float:left">
			<div class="cvForm">
	   			<h2><span class="orange">CV</span></h2>	
				<form id="cvForm" name = "cvForm"  action="ControllerCVManagement" method="POST">					
					<div class="formContent" >
										
						<label for="name">Your name<span class="name">required*</span></label>					
						<input type="text" name="name" id="name" class="input required" value="<% if ((String)session.getAttribute("name")!= null) out.print((String)session.getAttribute("name"));%>" />	
						
						<label for="sex">Sex<span class="name">required*</span></label>	
						<select id="sex" name="sex" class="input required" style="width:295px;">
							<option <% if((String)session.getAttribute("sex")=="Male") out.print("selected");%> >Male</option>
							<option <% if((String)session.getAttribute("sex")=="Female") out.print("selected");%> >Female</option>
						</select>
						
						<label for="email">Email<span class="name">required*</span></label>					
						<input type="text" name="email" id="email" class="input required" value="<% if ((String)session.getAttribute("email")!= null) out.print((String)session.getAttribute("email"));%>" />
						
						<label for="web">Web site<span class="name">required*</span></label>					
						<input type="text" name="web_site" id="web_site" class="input required" value="<% if ((String)session.getAttribute("web_site")!= null) out.print((String)session.getAttribute("web_site"));%>" />
						
						
						<label for="phone">Phone</label>					
						<input type="text" name="phone" id="phone" class="input required" value="<% if ((String)session.getAttribute("phone")!= null) out.print((String)session.getAttribute("phone"));%>" />
												
						<label for="date_birth">Date of birth (day/month/year)<span class="email">required*</span></label>
						<input type="text" name="date_birth" id="date_birth" class="input required" value="<% if ((String)session.getAttribute("date_birth")!= null) out.print((String)session.getAttribute("date_birth"));%>" />
						
						<label for="address">Address<span class="name">required*</span></label>					
						<input type="text" name="address" id="address" class="input required" value="<% if ((String)session.getAttribute("address")!= null) out.print((String)session.getAttribute("address"));%>" />
						
						<label for="levelstudy">Level of study<span class="name">required*</span></label>					
						<select id="levelstudy" name="levelstudy" class="input required" style="width:295px;">
							<option <% if((String)session.getAttribute("levelstudy") == "Bac+2") out.print("selected");%> >Bac+2</option>
							<option <% if((String)session.getAttribute("levelstudy") == "Bac+5") out.print("selected");%> >Bac+5</option>
							<option <% if((String)session.getAttribute("levelstudy") == "Master") out.print("selected");%>>Master</option>
						</select>
						
						<label for="year_experience">Year experience<span class="name" >required*</span></label>					
						<input type="text" name="year_experience" id="year_experience" class="input required" value="<% if ((String)session.getAttribute("year_experience")!= null) out.print((String)session.getAttribute("year_experience"));%>" />
						
						<label for="domain">Domain<span class="name">required*</span></label>					
						<select id="domain" name="domain" class="name" style="width:295px;">
							<option <% if((String)session.getAttribute("domain")=="Informatique") out.print("selected");%> >Informatique</option>
							<option <% if((String)session.getAttribute("domain")=="Economie") out.print("selected");%> >Economie</option>
							<option <% if((String)session.getAttribute("domain")=="Agriculture") out.print("selected");%> >Agriculture</option>
							<option <% if((String)session.getAttribute("domain")=="Elevage") out.print("selected");%> >Elevage</option>						
						</select>						
					
						<label for="specialite">Specialite<span class="name">required*</span></label>					
						<select id="specialite" name="specialite" class="name" style="width:295px;">
							<option <% if((String)session.getAttribute("specialite") == "Base de données") out.print("selected");%> >Base de données</option>
							<option <% if((String)session.getAttribute("specialite") == "Genie logiciel") out.print("selected");%> >Genie logiciel</option>
							<option <% if((String)session.getAttribute("specialite") == "Recherche opérationnelle") out.print("selected");%> >Recherche opérationnelle</option>
						</select>						
						
						<label for="languages">Languages<span class="name">required*</span></label>		
						<select id="languages" name="languages" class="name" style="width:295px;">
							<option <% if((String)session.getAttribute("languages") == "English") out.print("selected");%> >English</option>
							<option <% if((String)session.getAttribute("languages") == "VietNam") out.print("selected");%> >VietNam</option>
							<option <% if((String)session.getAttribute("languages") == "French") out.print("selected");%> >French</option>
						</select>
						
						<label for="position_wanted">Position Proposed<span class="name">required*</span></label>					
						<select id="position_wanted" name="position_wanted" class="name" style="width:295px;">
							<option <% if((String)session.getAttribute("position_wanted") == "Developpeur") out.print("selected");%> >Developpeur</option>
							<option <% if((String)session.getAttribute("position_wanted") == "Chef de projet") out.print("selected");%> >Chef de projet</option>
							<option <% if((String)session.getAttribute("position_wanted") == "Professeur") out.print("selected");%> >Designer</option>
						</select>	
						
						<label for="salary_wanted">Salary wanted<span class="name">required*</span></label>					
						<input type="text" name="salary_wanted" id="salary_wanted" class="input required" value="<% if ((String)session.getAttribute("salary_wanted")!= null) out.print((String)session.getAttribute("salary_wanted"));%>"  />
						
						<label for="description">Description about yourself</label>							
						<textarea class="textarea" name="description" id="description" rows="10" cols="10" >
							<% if((String)session.getAttribute("description")!= null) out.print((String)session.getAttribute("description"));%>
						</textarea>						
						<input type="hidden" name="contact_form" value="1" />						
						<div class="clear"></div>
						<div style="margin-top:20px">
						<button name="submit" type="submit" class=" submit" style="float:left;margin:5px"><span>Save CV</span></button>			
						</div>
					</div>
				</form>				
	   		</div>
		</div>
		<!-- END CONTACT FORM -->
		<!-- START IMAGES -->
		<div>
			<h2><a href="SearchJob.jsp"><span class="orange">Find high salary job with FEJOB</span></a></h2>
			<a href="SearchJob.jsp"><img src="images/slider/banner-m4.jpg" alt="FEJOB" /></a>
			<h2><a href="SearchJob.jsp"><span class="orange">Find excellent candidate with FEJOB</span></a></h2>
			<a href="SearchJob.jsp"><img src="images/slider/banner-m5.jpg" alt="FEJOB" /></a>
		</div>
		<!-- END IMAGES -->
	   	
	   	<div class="clear"></div>
	</div>
	<!-- END BOTTOM SECTION -->
	
   	<div class="clear"></div>
   	
	<!-- START FOOTER -->
   	<div class="container_12">
	   	<p class="footer">
	   		FEJOB_SUPERMAN_IFI
		</p>
	</div>
	<!-- END FOOTER -->
	
<!-- contact form validation -->
<script type="text/javascript">	
//<![CDATA[
  $(document).ready(function(){	
    $("#cvForm").validate({
		errorClass: "inputError",
		messages: {
			name: {	required: ""},sex: {	required: ""},phone: {	required: ""},date_birth: {	required: ""},
			email: {	required: ""},levelstudy: {	required: ""},year_experience: {	required: ""},domain: {	required: ""},languages: {	required: ""},position_wanted: {required: ""},
			salary_wanted: {	required: ""}
		}
	})
  });
 
//]]>
</script>

</body>
</html>